<?xml version="1.0" encoding="UTF-8"?> 
<!--
          

        Copyright  1990-2008 Sun Microsystems, Inc. All Rights Reserved.
        DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
        
        This program is free software; you can redistribute it and/or
        modify it under the terms of the GNU General Public License version
        2 only, as published by the Free Software Foundation.
        
        This program is distributed in the hope that it will be useful, but
        WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
        General Public License version 2 for more details (a copy is
        included at /legal/license.txt).
        
        You should have received a copy of the GNU General Public License
        version 2 along with this work; if not, write to the Free Software
        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
        02110-1301 USA
        
        Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
        Clara, CA 95054 or visit www.sun.com if you need additional
        information or have any questions.
-->
<!--
    This stylesheet outputs all constants definitions in form of C header file
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
<xsl:output method="text"/>
<!-- for pretty printing the comments -->
<xsl:include href="prettyPrint.xsl"/>

<xsl:template match="/">
/**
 * Copyright  1990-2008 Sun Microsystems, Inc. All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 only, as published by the Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License version 2 for more details (a copy is
 * included at /legal/license.txt).
 * 
 * You should have received a copy of the GNU General Public License
 * version 2 along with this work; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 * 
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
 * Clara, CA 95054 or visit www.sun.com if you need additional
 * information or have any questions.
 * 
 * These are constant defines both in native and Java layers.
 * NOTE: DO NOT EDIT. THIS FILE IS GENERATED. If you want to 
 * edit it, you need to modify the corresponding XML files.
 *
 * Patent pending.
 */
#ifndef _MIDP_CONSTANT_CORE_H_
#define _MIDP_CONSTANT_CORE_H_

#include &lt;pcsl_string.h&gt;

/**
 * @file
 *
 * Constant defination file.
 * Automatic generated. Do not edit this file.
 */
<!-- for each constant_class -->
<xsl:for-each select="/configuration/constants/constant_class">
    <!-- 
        generate constants only when value of 'JavaOnly' 
        attribute isn't 'true'
    -->
    <xsl:if test="@JavaOnly!='true'">
        <xsl:apply-templates>
        </xsl:apply-templates>
    </xsl:if>
</xsl:for-each>
#endif /* _MIDP_CONSTANT_CORE_H_ */
</xsl:template>

<!-- template to generate constant definition -->
<xsl:template match="constant">
<xsl:if test="@JavaOnly!='true'">
/**
<xsl:call-template name="prettyPrint">
    <xsl:with-param name="outputString" select="normalize-space(@Comment)"/>
    <xsl:with-param name="indentString" select="' * '"/>
    <xsl:with-param name="maxWidth" select="75"/>
</xsl:call-template>
 *
 * Package: <xsl:value-of select="../@Name"/>
 */ <xsl:text>&#10;</xsl:text>
    <xsl:choose>
    <xsl:when test="@Type='String'">
	<xsl:text>extern const pcsl_string </xsl:text>
	<xsl:value-of select="@Name"/>
	<xsl:text>;</xsl:text>
    </xsl:when>
    <xsl:otherwise>
	<xsl:text>#define </xsl:text>
	<xsl:value-of select="@Name"/><xsl:text> </xsl:text>
	<xsl:choose>
	<xsl:when test="@Value='true'">
    	    <xsl:text>1</xsl:text>
    	</xsl:when>
        <xsl:when test="@Value='false'">
	    <xsl:text>0</xsl:text>
    	</xsl:when>
        <xsl:otherwise>
	    <xsl:value-of select="@Value"/>
    	</xsl:otherwise>
	</xsl:choose>
    </xsl:otherwise>
    </xsl:choose>
<xsl:text>
</xsl:text>
</xsl:if> <!-- JavaOnly -->
</xsl:template>

</xsl:stylesheet>
